package com.cq.hd.common.enums.biz;

import lombok.Getter;

/**
 * @description: 商家类型：商场（大型商家）、非商场（中小型商家）
 * @author: mYunYu
 * @date: 2021/8/23 14:28
 * @version: v1.0
 */
public enum BusinessTypeEnum {

    SC(1, "商场"),
    NSC(2, "非商场"),
    ;

    @Getter
    private final Integer value;

    @Getter
    private final String name;

    BusinessTypeEnum(Integer value, String name) {
        this.value = value;
        this.name = name;
    }

    public static BusinessTypeEnum typeOf(Integer value) {
        BusinessTypeEnum[] values = BusinessTypeEnum.values();
        for (BusinessTypeEnum v : values) {
            if (v.value.equals(value)) {
                return v;
            }
        }
        return null;
    }

    public static BusinessTypeEnum typeOf(String name) {
        BusinessTypeEnum[] values = BusinessTypeEnum.values();
        for (BusinessTypeEnum v : values) {
            if (v.name.equals(name)) {
                return v;
            }
        }
        return null;
    }


}
